<%@ page import="com.liferay.portal.service.ResourceActionLocalServiceUtil" %>
<%@ page import="com.liferay.portal.model.ResourceAction" %>
<%@ page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil" %>
<%@ page import="com.liferay.portal.service.RoleLocalServiceUtil" %>
<%@ page import="com.liferay.portal.service.OrganizationLocalServiceUtil" %>
<%@ page import="com.liferay.portal.model.UserGroupRole" %>
<%@ page import="com.liferay.portal.model.Role" %>
<%@ page import="com.liferay.portal.model.RoleConstants" %>
<%@ page import="com.liferay.portal.model.Organization" %>
<%@ page import="com.liferay.portal.NoSuchRoleException" %>
<%@ page import="java.util.*" %>

<%

	boolean isPortalAdmin = false;
	boolean hasViewCost = false;
	
	if (!permissionChecker.isOmniadmin()) {
		
		String portletId = portletDisplay.getRootPortletId();	
		List<ResourceAction> resourceActions = ResourceActionLocalServiceUtil.getResourceActions(portletId);		
	
		for (ResourceAction ra : resourceActions) {
			String actionId = ra.getActionId();
			boolean hasPermission = permissionChecker.hasPermission(scopeGroupId, portletId, portletDisplay.getResourcePK(), actionId);			
			if (actionId.equals("viewCost") && hasPermission) {
				hasViewCost = true;
				break;
			}
		}	
	} else {
		isPortalAdmin = true;
		hasViewCost = true;
	}
%>